package com.xneure.enging.widget.tabs;

import com.xneure.enging.ui.element.tabs.UiTabs;
import com.xneure.enging.widget.Control;
import com.xneure.enging.widget.Widget;

public class Tabs extends Widget<UiTabs> {

	public Tabs(Control parent) {
		super(parent);
	}

	public void setHeight(String height) {
		setStyle("height", height);
	}

	public void setWidth(String width) {
		setStyle("width", width);
	}

	@Override
	public void addElement(Control elem) {
		super.addElement(elem);
		int w = 95 / getElems().size();
		for (Control e : getElems()) {
			Tab tab = (Tab) e;
			tab.setWidth(w + "%");
		}
	}

}
